<!DOCTYPE html>
<html lang="en">

    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
        <style>
        /* li:nth-of-type(2){background-color: blueviolet;} */
        /* li:nth-child(2){background-color: blueviolet;} */
        /* li:nth-child(2n){background-color: red;}   */
        /* li:last-of-type{background-color: brown;} */
        /* li:only-of-type{background-color: red;} */
        div:only-of-type {
            background-color: red;
        }
    </style>
    </head>

    <body>
        <ul>
            <li></li>
            <div>aaaaa</div>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>
    </body>

</html>